*Figure 1: China’s gradual participation in the LIO
use "data_fig_1.dta" 
preserve
collapse (mean) total_io_cn total_io_western, by(year)
tsset year
tsline total_io_cn total_io_western if year<2014
restore


*1. Import data
import delimited "pausellietal.csv", varnames(1)

*2. Format variables
tab treated
gen treated_dummy=1 if treated=="1"
replace treated_dummy=0 if treated_dummy==.
destring against, replace force
destring ideology_left , replace force
destring v2x_libdem, replace force
gen interaction = china_sup*treated_dummy
egen country_code=group(country_str )
egen title_code=group(title)
gen global_south=0 if country_code ==9 | country_code ==10  | country_code ==15 | country_code ==18| country_code ==21| country_code ==25| country_code ==30| country_code ==32| country_code ==34| country_code ==40| country_code ==43| country_code ==44| country_code ==47| country_code ==50| country_code ==51| country_code ==55| country_code ==56| country_code ==58| country_code ==64| country_code ==67| country_code ==70| country_code ==80| country_code ==85| country_code ==92| country_code ==93| country_code ==94| country_code ==95 | country_code == 101| country_code == 102| country_code == 105| country_code ==106 | country_code == 109 | country_code == 115| country_code == 116| country_code ==117
replace global_south =1 if global_south ==.
gen placebo_treated = treated_dummy
replace placebo_treated =0 if year ==2014
replace placebo_treated =1 if year ==2013
tab placebo_treated
tabstat treated_dummy , by(year)
tabstat treated_dummy placebo_treated  , by(year)
replace treated_dummy  =1 if year ==2008
replace treated_dummy  =1 if year ==2017
replace placebo_treated =1 if year==2008
replace placebo_treated =1 if year==2017
tabstat treated_dummy placebo_treated , by(year)
replace oda=oda/1000000
replace chinese_fdi = chinese_fdi/1000000
gen random=1 if random_resolutions =="Yes"
replace random=0 if random==.
destring treated_india , replace force
gen india_sup=1 if india_support =="Yes"
replace india_sup=0 if india_support =="No"


** Table 1: Descriptive statistics
sum against  china_sup i.treated_dummy ideology_left v2x_libdem  agree_china oda_cn chinese_fdi   if v2x_libdem!=.